//
//  ESVideoCell.m
//  Eyeshot
//
//  Created by lanou3g on 15/7/2.
//  Copyright (c) 2015年 eyeshot. All rights reserved.
//

#import "ESVideoCell.h"

@implementation ESVideoCell
-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
    }
    return self;
}

- (void)setVideoVC:(ESVideoVC *)videoVC {
    _videoVC = videoVC;
    _videoVC.tableView.x = ZERO;
    _videoVC.tableView.y = ZERO;
    _videoVC.tableView.width = SCREEN_WIDTH;
    _videoVC.tableView.height = SCREEN_HEIGHT - BAR_HEIGHT - CATEGORY_BAR_HEIGHT;
    
    NSArray *views = self.contentView.subviews;
    BOOL hasTableView = NO;
    for (int i = 0; i < views.count; i++) {
        if ([views[i] isKindOfClass:[UITableView class]]) {
            hasTableView = YES;
        }
    }
    if (!hasTableView) {
        [self.contentView addSubview:_videoVC.tableView];
    }
}
@end
